<?php
	header("Access-Control-Allow-Origin:*");
	$userphone = $_POST["userphone"];
	$password = $_POST["password"];
	$conn = mysqli_connect("localhost", "root", "root", "text2"); 
	$sql = "SELECT * FROM incake WHERE userphone='$userphone' AND password='$password'";
	$result = mysqli_query($conn, $sql);
	if (mysqli_num_rows($result) === 1) {
	$row = mysqli_fetch_assoc($result);
		$arr = array("res_code"=>1, "res_message"=>"success", "res_body"=>$row);
		echo json_encode($arr);
	} else { // 用户名或密码错误
		$arr = array("res_code"=>-1, "res_message"=>"error");
		echo json_encode($arr);
	}
	mysqli_close($conn);
?>